<html>
<head><meta charset="utf-8"><title>rust-project.json · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html">rust-project.json</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="188118314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118314">(Feb 13 2020 at 15:43)</a>:</h4>
<p>is the rust-project.json format documented anywhere?</p>



<a name="188118479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118479">(Feb 13 2020 at 15:45)</a>:</h4>
<p>also, is it possible to use rust-project.json to describe hundreds of various binary/library targets? or would there need to be one per crate like Cargo.toml files?</p>



<a name="188118617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118617">(Feb 13 2020 at 15:46)</a>:</h4>
<p><span class="user-mention" data-user-id="217516">@Benjamin Brittain</span> it's not docummented, there's only a test. You need one project.json file which descibes the whole web of crates you are compiling</p>



<a name="188118664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118664">(Feb 13 2020 at 15:47)</a>:</h4>
<p>What are your use-case for project.json ?</p>



<a name="188118776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118776">(Feb 13 2020 at 15:48)</a>:</h4>
<p>The problem with it is that I really want to support non-CArgo based proejcts (mostly to make sure that the abstraction is right), but, as almost everyone uses Cargo, this functionality is not really well tested at all</p>



<a name="188118826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118826">(Feb 13 2020 at 15:48)</a>:</h4>
<p>I'm reworking the Rust rules in Fuchsia, and I'm <em>so tired</em> of our Cargo.toml hacks</p>



<a name="188118867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118867">(Feb 13 2020 at 15:49)</a>:</h4>
<p>I'm probably like the only person who needs this :P</p>



<a name="188118868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118868">(Feb 13 2020 at 15:49)</a>:</h4>
<p>Oh yeah, this is exactly use-case for project.json</p>



<a name="188118906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118906">(Feb 13 2020 at 15:49)</a>:</h4>
<p><span class="user-mention" data-user-id="217516">@Benjamin Brittain</span> I think you are rougthly 50% off the audience, the other half should be Facebook :D</p>



<a name="188118937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188118937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188118937">(Feb 13 2020 at 15:49)</a>:</h4>
<p>sounds about right <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="188119013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119013">(Feb 13 2020 at 15:50)</a>:</h4>
<p>ok, I might have questions then. Can you point me to the test?</p>



<a name="188119038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119038">(Feb 13 2020 at 15:50)</a>:</h4>
<p>If it's not straightforward I'll try to write up some docs in parallel</p>



<a name="188119130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119130">(Feb 13 2020 at 15:51)</a>:</h4>
<p>So, rust-analyzer works with a set of crates at a time (in contrast with rustc, which works crate at a time).</p>
<p>So what project.json does is it describes the graph of crates.</p>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/blob/4444192b05c107a40a5a05ea3c9091ad8f8cbbcc/crates/ra_lsp_server/tests/heavy_tests/main.rs#L380" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/4444192b05c107a40a5a05ea3c9091ad8f8cbbcc/crates/ra_lsp_server/tests/heavy_tests/main.rs#L380">https://github.com/rust-analyzer/rust-analyzer/blob/4444192b05c107a40a5a05ea3c9091ad8f8cbbcc/crates/ra_lsp_server/tests/heavy_tests/main.rs#L380</a></p>



<a name="188119154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119154">(Feb 13 2020 at 15:52)</a>:</h4>
<p>can rust-analyzer handle ~2000 crates?</p>



<a name="188119216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119216">(Feb 13 2020 at 15:52)</a>:</h4>
<p>In particular, the nodes in graph are anonymous (names that you see in <code>extern crate foo</code> are written on edges), and you can "instantiate" sevetal crates from a single file.</p>



<a name="188119267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119267">(Feb 13 2020 at 15:53)</a>:</h4>
<blockquote>
<p>can rust-analyzer handle ~2000 crates?</p>
</blockquote>
<p>In theory, yes, in practice, I hanve't tried that big projects</p>



<a name="188119276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119276">(Feb 13 2020 at 15:53)</a>:</h4>
<p>cool, I'm ready to be a stress test</p>



<a name="188119282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119282">(Feb 13 2020 at 15:53)</a>:</h4>
<p>but it can handle rustc, for examle</p>



<a name="188119318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119318">(Feb 13 2020 at 15:53)</a>:</h4>
<p>In general, the processing of rust-analyzer should be sublinear, so in theory we should scale pretty well.</p>



<a name="188119334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119334">(Feb 13 2020 at 15:53)</a>:</h4>
<p><em>fancy</em></p>



<a name="188119410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119410">(Feb 13 2020 at 15:54)</a>:</h4>
<p>A major limitation in practice is that we do keep all the data in memory at the moment, so several gig for rust-analyzer is not unheard of</p>



<a name="188119447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119447">(Feb 13 2020 at 15:54)</a>:</h4>
<p>my workstation has 196Gb of RAM. I think I'll be Ok</p>



<a name="188119463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119463">(Feb 13 2020 at 15:54)</a>:</h4>
<p>yup, that should be fine</p>



<a name="188119538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119538">(Feb 13 2020 at 15:55)</a>:</h4>
<p>but I'd like people who do OSS work (who usually don't have as powerful machines) to be able to use this too :(</p>
<p>are there plans to move some things to disk?</p>



<a name="188119569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119569">(Feb 13 2020 at 15:56)</a>:</h4>
<p>Eventual plans, not immediate plans</p>



<a name="188119620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119620">(Feb 13 2020 at 15:56)</a>:</h4>
<p>and it might make more sense to just optimize data structures though</p>



<a name="188119650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119650">(Feb 13 2020 at 15:56)</a>:</h4>
<p>sounds good! Thanks for the super rapid answers to all my questions :D</p>



<a name="188119656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119656">(Feb 13 2020 at 15:56)</a>:</h4>
<p>basically, we are roughtly 30% into "make it work" phase, we haven't started on "make it fast/make it smol" yet :)</p>



<a name="188119811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188119811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188119811">(Feb 13 2020 at 15:58)</a>:</h4>
<p>unfortunately, I still need to generate Cargo.toml files for people using RLS :(<br>
but this should be a superior workflow</p>



<a name="188120151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188120151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188120151">(Feb 13 2020 at 16:01)</a>:</h4>
<p>That's not officially decided, but we might want to deprecate RLS soon</p>



<a name="188120226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188120226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188120226">(Feb 13 2020 at 16:02)</a>:</h4>
<p>I would like you to come and tell people here that their workflow is broken. <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="188120272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188120272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188120272">(Feb 13 2020 at 16:02)</a>:</h4>
<p>but yeah, that totally makes sense</p>



<a name="188120311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188120311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188120311">(Feb 13 2020 at 16:02)</a>:</h4>
<p>the people using intelij are not gonna be happy when I remove Cargo.toml support though</p>



<a name="188120428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188120428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188120428">(Feb 13 2020 at 16:03)</a>:</h4>
<p>It should be not that hard to add rust-project.json support to IntelliJ </p>
<p>cc <span class="user-mention" data-user-id="200750">@Vlad</span> , wdyt about quasi-standard Cargo-independent way to describe rust-projects?</p>



<a name="188121708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188121708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188121708">(Feb 13 2020 at 16:15)</a>:</h4>
<p>Just as a sidenote: I would suggest not using <code>.json</code> format for such config files, <code>.toml</code> or as a last resort <code>.yaml</code> are much better for this ...</p>



<a name="188121858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188121858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188121858">(Feb 13 2020 at 16:17)</a>:</h4>
<p>why?</p>



<a name="188121868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188121868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188121868">(Feb 13 2020 at 16:17)</a>:</h4>
<p>This is intended to be a machine-generated files, and it's usually easier to produce and consume JSON than human readable format.</p>



<a name="188121938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188121938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188121938">(Feb 13 2020 at 16:17)</a>:</h4>
<p>I actively war against yaml :P</p>



<a name="188121942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188121942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188121942">(Feb 13 2020 at 16:17)</a>:</h4>
<p>even for human readable</p>



<a name="188121947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188121947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188121947">(Feb 13 2020 at 16:17)</a>:</h4>
<p>Though, we probably could use TOML, as the nesting is shallow</p>



<a name="188122023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122023">(Feb 13 2020 at 16:18)</a>:</h4>
<p>I'd really prefer json tbh. Most build system tooling already has a way to consume JSON</p>



<a name="188122036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122036">(Feb 13 2020 at 16:18)</a>:</h4>
<p>TOML is very rust ecosystem centric</p>



<a name="188122043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122043">(Feb 13 2020 at 16:18)</a>:</h4>
<p>and yeah, yaml is not my cup of tea. At least 30% of my "fix CI" commits are about fixing yaml syntax</p>



<a name="188122077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122077">(Feb 13 2020 at 16:18)</a>:</h4>
<blockquote>
<p>TOML is very rust ecosystem centric</p>
</blockquote>
<p>I think Go uses Toml as well though?</p>



<a name="188122108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122108">(Feb 13 2020 at 16:19)</a>:</h4>
<p>but yeah, agree that JSON is less weird  option</p>



<a name="188122174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122174">(Feb 13 2020 at 16:19)</a>:</h4>
<p>I just turned around and asked someone who works on Go</p>
<p>"It does not"</p>



<a name="188122271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122271">(Feb 13 2020 at 16:20)</a>:</h4>
<p>If this is machine-generated and nothing more, than alright...<br>
It's just <code>.json</code> doesn't natively support comments, may be quite verbose and it's just my gory experience of <code>.json</code> programming (i.e. imitating function call syntax and in fact writing programs with logic in <code>.json</code> files...)</p>



<a name="188122360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122360">(Feb 13 2020 at 16:21)</a>:</h4>
<p>back to the quasi-standard, that would make me very happy</p>



<a name="188122361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122361">(Feb 13 2020 at 16:21)</a>:</h4>
<p>ah, that was <code>go dep</code>, which was subsumed by go mod: <a href="https://github.com/golang/dep/blob/master/Gopkg.toml" target="_blank" title="https://github.com/golang/dep/blob/master/Gopkg.toml">https://github.com/golang/dep/blob/master/Gopkg.toml</a></p>



<a name="188122396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122396">(Feb 13 2020 at 16:21)</a>:</h4>
<p>I've basically removed Cargo usage from our project with the exception of vendoring</p>



<a name="188122421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122421">(Feb 13 2020 at 16:21)</a>:</h4>
<p>and needing any form of the files makes my life very frustrating</p>



<a name="188122499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122499">(Feb 13 2020 at 16:22)</a>:</h4>
<p><span class="user-mention" data-user-id="217516">@Benjamin Brittain</span> , might I ask why do you drop cargo?</p>



<a name="188122585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122585">(Feb 13 2020 at 16:23)</a>:</h4>
<p>because we have a lot of cross-language dependencies and a large amount of infrastructure dedicated to other build systems</p>



<a name="188122610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122610">(Feb 13 2020 at 16:23)</a>:</h4>
<p>Cargo also has many pain points once you grow to be a large project</p>



<a name="188122699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122699">(Feb 13 2020 at 16:24)</a>:</h4>
<p>where large means 10k+ individual targets</p>



<a name="188122953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188122953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188122953">(Feb 13 2020 at 16:26)</a>:</h4>
<p>And what do you do you to replace cargo?</p>



<a name="188123017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123017">(Feb 13 2020 at 16:27)</a>:</h4>
<p>I thought cargo was supposed to simplify all that build systems configuration stuff</p>



<a name="188123044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123044">(Feb 13 2020 at 16:27)</a>:</h4>
<p>most people aren't building operating systems</p>



<a name="188123053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123053">(Feb 13 2020 at 16:27)</a>:</h4>
<p>in this case, GN</p>



<a name="188123054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123054">(Feb 13 2020 at 16:27)</a>:</h4>
<p><a href="https://gn.googlesource.com/gn" target="_blank" title="https://gn.googlesource.com/gn">https://gn.googlesource.com/gn</a></p>



<a name="188123087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123087">(Feb 13 2020 at 16:27)</a>:</h4>
<p>See also <a href="https://rust-lang.github.io/rfcs/2136-build-systems.html" target="_blank" title="https://rust-lang.github.io/rfcs/2136-build-systems.html">https://rust-lang.github.io/rfcs/2136-build-systems.html</a></p>



<a name="188123186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123186">(Feb 13 2020 at 16:28)</a>:</h4>
<p>Basically, "integration with other build system" is a problem on which Cargo team spend a couple of years on and off, and which wasn't resolved in a satisfactory way.</p>



<a name="188123218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123218">(Feb 13 2020 at 16:28)</a>:</h4>
<p>It's also really hard to justify working on</p>



<a name="188123255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123255">(Feb 13 2020 at 16:29)</a>:</h4>
<p>like, we can just throw people at the problem to make it go away</p>



<a name="188123279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188123279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188123279">(Feb 13 2020 at 16:29)</a>:</h4>
<p>and most people using their own build system can do that</p>



<a name="188126747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126747">(Feb 13 2020 at 17:03)</a>:</h4>
<div class="codehilite"><pre><span></span>    let project = json!({
        &quot;roots&quot;: [path],
        &quot;crates&quot;: [ {
            &quot;root_module&quot;: path.join(&quot;src/lib.rs&quot;),
            &quot;deps&quot;: [],
            &quot;edition&quot;: &quot;2015&quot;,
            &quot;atom_cfgs&quot;: [],
            &quot;key_value_cfgs&quot;: {}
        } ]
    });
</pre></div>



<a name="188126820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126820">(Feb 13 2020 at 17:04)</a>:</h4>
<p>ok, some of that is obvious</p>



<a name="188126848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126848">(Feb 13 2020 at 17:04)</a>:</h4>
<p>what is <code>atom_cfgs</code> &amp; <code>key_value_cfgs</code></p>



<a name="188126870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126870">(Feb 13 2020 at 17:04)</a>:</h4>
<p>that's <code>--cfg</code> flags you pass on the command line</p>



<a name="188126881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126881">(Feb 13 2020 at 17:05)</a>:</h4>
<p>NICE</p>



<a name="188126898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126898">(Feb 13 2020 at 17:05)</a>:</h4>
<p>which are either <code>--cfg=foo</code>, or <code>--cfg=foo=bar</code></p>



<a name="188126922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126922">(Feb 13 2020 at 17:05)</a>:</h4>
<p>yeah, that makes total sense now</p>



<a name="188126929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126929">(Feb 13 2020 at 17:05)</a>:</h4>
<p>So, in theory, you can instantiate the same crate with two sets of different cfgs</p>



<a name="188126956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188126956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188126956">(Feb 13 2020 at 17:05)</a>:</h4>
<p>uh, I do need to do that <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="188127012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188127012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188127012">(Feb 13 2020 at 17:06)</a>:</h4>
<p>host side &amp; target side compilation is very common</p>



<a name="188127104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188127104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188127104">(Feb 13 2020 at 17:07)</a>:</h4>
<p>Yeah, in theory you should be able to have diffrent target-trippled crates in the same graph</p>



<a name="188127221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188127221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188127221">(Feb 13 2020 at 17:08)</a>:</h4>
<p>Though i am not sure if that would <em>just</em> work in practice. We do some sniffing of <code>rustc --print cfg</code>, whcih just uses HOST, but I think rust-project.json should override that</p>



<a name="188137362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188137362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188137362">(Feb 13 2020 at 18:52)</a>:</h4>
<p>ok, about to take a crack at this.</p>
<p>deps are just the crate_name and r-a handles the resolution?</p>



<a name="188137448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188137448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188137448">(Feb 13 2020 at 18:53)</a>:</h4>
<p>and <code>roots</code> is a scratch space?</p>



<a name="188139395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139395">(Feb 13 2020 at 19:10)</a>:</h4>
<p>each dep is something like <code>{"crate": 0, "name": "crate_name"}</code>, where the <code>0</code> is the index of the crate in the crates array, and the <code>"crate_name"</code> is the name of the dependency (think <code>rename</code> in cargo)</p>



<a name="188139409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139409">(Feb 13 2020 at 19:10)</a>:</h4>
<p>so no, you have to resolve it</p>



<a name="188139616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139616">(Feb 13 2020 at 19:12)</a>:</h4>
<p>interesting. so hypothetically It can handle crates with the same name?</p>



<a name="188139619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139619">(Feb 13 2020 at 19:12)</a>:</h4>
<p><code>roots</code> are the directories containing rust crates; RA will watch all rust code in each of these. All the crates must be in one of these, I think. I don't know if this affects anything else; RA has a notion of library roots, but I don't know how that maps to this</p>



<a name="188139666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139666">(Feb 13 2020 at 19:13)</a>:</h4>
<blockquote>
<p>interesting. so hypothetically It can handle crates with the same name?</p>
</blockquote>
<p>well, basically crates just have no name in this model. the name is a property of the dependency edge</p>



<a name="188139829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139829">(Feb 13 2020 at 19:14)</a>:</h4>
<blockquote>
<p>RA has a notion of library roots</p>
</blockquote>
<p>(the effect of this is that certain optimizations are activated that assume that the code in that root usually won't change)</p>



<a name="188139848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139848">(Feb 13 2020 at 19:14)</a>:</h4>
<p>I'll write a small test rust-project.json and see if it works the way I think</p>



<a name="188139899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139899">(Feb 13 2020 at 19:15)</a>:</h4>
<p>I'm very excited</p>



<a name="188139938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188139938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188139938">(Feb 13 2020 at 19:15)</a>:</h4>
<p>ok, from reading the code it looks like we just consider all roots non-library for json projects, which is probably fair</p>



<a name="188140013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188140013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188140013">(Feb 13 2020 at 19:16)</a>:</h4>
<p>note that you need to include the sysroot crates as well (i.e. <code>std</code> and so on), they aren't automatically added</p>



<a name="188140020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188140020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188140020">(Feb 13 2020 at 19:16)</a>:</h4>
<p>yeah, that's fine</p>



<a name="188140026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188140026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188140026">(Feb 13 2020 at 19:16)</a>:</h4>
<p>makes sense</p>



<a name="188141639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188141639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188141639">(Feb 13 2020 at 19:32)</a>:</h4>
<p>how do I see R-A logs and whatnot?</p>



<a name="188141658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188141658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188141658">(Feb 13 2020 at 19:32)</a>:</h4>
<p>(deleted)</p>



<a name="188152985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188152985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188152985">(Feb 13 2020 at 21:20)</a>:</h4>
<p>I started writting out a simple one by hand</p>
<div class="codehilite"><pre><span></span>    &quot;roots&quot;: [&quot;/usr/local/google/home/bwb/fuchsia/src/lib/zircon/rust/fuchsia-zircon-status/&quot;, &quot;/usr/local/google/home/bwb/fuchsia/out/default.zircon/user.vdso-x64-clang.shlib/gen/zircon/syscalls/&quot;],
    &quot;crates&quot;: [
      {
        &quot;root_module&quot;: &quot;/usr/local/google/home/bwb/fuchsia/out/default.zircon/user.vdso-x64-clang.shlib/gen/zircon/syscalls/definitions.rs&quot;,
        &quot;deps&quot;: [],
        &quot;edition&quot;: &quot;2018&quot;,
        &quot;atom_cfgs&quot;: [],
        &quot;key_value_cfgs&quot;: {}
      },
      {
        &quot;root_module&quot;: &quot;/usr/local/google/home/bwb/fuchsia/src/lib/zircon/rust/fuchsia-zircon-status/src/lib.rs&quot;,
        &quot;deps&quot;: [ {&quot;crate&quot;: 0, &quot;name&quot;: &quot;fuchsia_zircon_sys&quot;} ],
        &quot;edition&quot;: &quot;2018&quot;,
        &quot;atom_cfgs&quot;: [],
        &quot;key_value_cfgs&quot;: {}
      }
   ]
}
</pre></div>



<a name="188153013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188153013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188153013">(Feb 13 2020 at 21:21)</a>:</h4>
<p>but it doesn't seem to pick up sys</p>



<a name="188153074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188153074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188153074">(Feb 13 2020 at 21:21)</a>:</h4>
<p>also if you say <code>fuchsia-zircon-sys</code> r-a is _not happy_ <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="188153174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188153174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188153174">(Feb 13 2020 at 21:22)</a>:</h4>
<p>anything I should fix before I go digging through the source code?</p>



<a name="188153436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188153436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188153436">(Feb 13 2020 at 21:24)</a>:</h4>
<p>oh wait, I think it does work!</p>



<a name="188153448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188153448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188153448">(Feb 13 2020 at 21:24)</a>:</h4>
<p>I just had a silly typo and it didn't surface the error</p>



<a name="188154228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188154228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188154228">(Feb 13 2020 at 21:31)</a>:</h4>
<p>this is gonna be really slick</p>



<a name="188154272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188154272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188154272">(Feb 13 2020 at 21:32)</a>:</h4>
<p>I'm very happy with this format</p>



<a name="188158640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188158640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188158640">(Feb 13 2020 at 22:20)</a>:</h4>
<blockquote>
<p>also if you say fuchsia-zircon-sys r-a is _not happy_ <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>
</blockquote>
<p>Because that's not a valid identifier. The name in the dep is literarly the identifier you'll use in an <code>.rs</code> file.</p>



<a name="188158691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188158691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188158691">(Feb 13 2020 at 22:20)</a>:</h4>
<p>oh yeah, I know that</p>



<a name="188158708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188158708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188158708">(Feb 13 2020 at 22:21)</a>:</h4>
<p>but we use dashes everywhere so I typed it in reflexivly</p>



<a name="188158736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188158736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188158736">(Feb 13 2020 at 22:21)</a>:</h4>
<p>our build rules convert - to _</p>



<a name="188165610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188165610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188165610">(Feb 13 2020 at 23:59)</a>:</h4>
<p>AND IT WORKS \o/</p>



<a name="188165613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188165613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188165613">(Feb 13 2020 at 23:59)</a>:</h4>
<p>it's amazing</p>



<a name="188165627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188165627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188165627">(Feb 13 2020 at 23:59)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> thank you so much</p>



<a name="188165955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188165955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188165955">(Feb 14 2020 at 00:03)</a>:</h4>
<p>I am extremely glad to receive the first report about rust-project.json actually working about a year after the feature was implemented :D</p>



<a name="188166550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188166550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188166550">(Feb 14 2020 at 00:13)</a>:</h4>
<p>It's a little slow on startup, not sure how long r-a usually takes</p>



<a name="188166557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188166557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188166557">(Feb 14 2020 at 00:13)</a>:</h4>
<p>only ~2k targets right now</p>



<a name="188166619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188166619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188166619">(Feb 14 2020 at 00:14)</a>:</h4>
<p>we have more, but I've been using a subset</p>



<a name="188166641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188166641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188166641">(Feb 14 2020 at 00:14)</a>:</h4>
<p>Yeah, as we don't save anything to disk, we need to run some analyzis on the startup</p>



<a name="188166653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188166653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188166653">(Feb 14 2020 at 00:14)</a>:</h4>
<p>Though, it still should be significanlty faster than compiling the code</p>



<a name="188166881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188166881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188166881">(Feb 14 2020 at 00:19)</a>:</h4>
<p>several orders of magnitude faster :)</p>



<a name="188168522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188168522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188168522">(Feb 14 2020 at 00:48)</a>:</h4>
<p>Is there an easy way to convert Cargo.toml output into this format?</p>



<a name="188168558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188168558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188168558">(Feb 14 2020 at 00:49)</a>:</h4>
<p>although I'm about to remove it, our third_party code builds with Cargo right now</p>



<a name="188168612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188168612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188168612">(Feb 14 2020 at 00:50)</a>:</h4>
<p>I have a plan that will almost work, but it'd be nice to leverage cargo to do the work for me</p>



<a name="188168751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188168751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188168751">(Feb 14 2020 at 00:53)</a>:</h4>
<p>Nope, there isn't such a way</p>



<a name="188168796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188168796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188168796">(Feb 14 2020 at 00:54)</a>:</h4>
<p>that's fine. that's _very niche_</p>



<a name="188168806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188168806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188168806">(Feb 14 2020 at 00:54)</a>:</h4>
<p>even more than using this format at all</p>



<a name="188172184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188172184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188172184">(Feb 14 2020 at 02:03)</a>:</h4>
<p>ok, it was surprisingly easy to walk a vendored cargo.toml setup and generate this</p>



<a name="188242265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242265">(Feb 14 2020 at 20:16)</a>:</h4>
<p>So it <em>looks</em> like everything is working, but it debug prints unresolved imports. Any way to get access to that so I can figure out how to make this perfct?</p>



<a name="188242327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242327">(Feb 14 2020 at 20:16)</a>:</h4>
<blockquote>
<p>but it debug prints unresolved imports</p>
</blockquote>
<p>Hm, not sure I understad what happes</p>



<a name="188242337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242337">(Feb 14 2020 at 20:16)</a>:</h4>
<p>Could you show what exactly is printed where?</p>



<a name="188242358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242358">(Feb 14 2020 at 20:17)</a>:</h4>
<p>"name resolution is stuck"</p>



<a name="188242394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242394">(Feb 14 2020 at 20:17)</a>:</h4>
<p>which looks like it happens when resolving imports<br>
<code>[ERROR ra_hir_def::nameres::collector] name resolution is stuck</code></p>



<a name="188242488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242488">(Feb 14 2020 at 20:18)</a>:</h4>
<p>oh, interesting</p>



<a name="188242495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242495">(Feb 14 2020 at 20:19)</a>:</h4>
<p>It tried resolving imports 1000 times (any reason for this constant?) , then gave up</p>



<a name="188242502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242502">(Feb 14 2020 at 20:19)</a>:</h4>
<p>THat's basically a rust-analyzer requivalent of ICE</p>



<a name="188242509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242509">(Feb 14 2020 at 20:19)</a>:</h4>
<p>This should not be happening</p>



<a name="188242515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242515">(Feb 14 2020 at 20:19)</a>:</h4>
<p>hahaha</p>



<a name="188242533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242533">(Feb 14 2020 at 20:19)</a>:</h4>
<p>I make rustc ICE regularly. this doesn't seem atypical to me :P</p>



<a name="188242543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242543">(Feb 14 2020 at 20:19)</a>:</h4>
<blockquote>
<p>It tried resolving imports 1000 times (any reason for this constant?) , then gave up</p>
</blockquote>
<p>That's just a safeguard: we can not afford to spin indefinitelly even in the case of bugs.</p>



<a name="188242617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242617">(Feb 14 2020 at 20:20)</a>:</h4>
<p>how many times is this loop usually called?</p>



<a name="188242623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242623">(Feb 14 2020 at 20:20)</a>:</h4>
<p>is this just because of the 2k+ crates?</p>



<a name="188242659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242659">(Feb 14 2020 at 20:21)</a>:</h4>
<p>I don't know anything about how this is architected, sorry for the potentially silly questions</p>



<a name="188242698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242698">(Feb 14 2020 at 20:21)</a>:</h4>
<p>IDE sees all kinds of wired incomplete code code, so it tends to crash more often than a compiler. Moreover, the cost of IDE crash is much higher, because it's a long-lived process, and not a batch one. For this reason, we embrace the existance of bugs and try to mitigate their consequences</p>



<a name="188242800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242800">(Feb 14 2020 at 20:22)</a>:</h4>
<p>this might just be that I don't have CFGs wired properly then and it thinks a lot of code is perpetually incomplete</p>



<a name="188242833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242833">(Feb 14 2020 at 20:22)</a>:</h4>
<blockquote>
<p>21:20</p>
</blockquote>
<p>how many times is this loop usually called?</p>
<p>I haen't measured, but I'd expect less than a dozen calls for typical usecases. I don't think this relates to the number of crates. Rather, it's more likely that, among all that code, there's  a particular code pattern that exposes a buggy behavior in our name resolution</p>



<a name="188242877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242877">(Feb 14 2020 at 20:23)</a>:</h4>
<blockquote>
<p>this might just be that I don't have CFGs wired properly then and it thinks a lot of code is perpetually incomplete</p>
</blockquote>
<p>Even if the code is completely broken, this loop should terminated</p>



<a name="188242906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242906">(Feb 14 2020 at 20:24)</a>:</h4>
<p>any guidance on gathering a repro?</p>



<a name="188242938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242938">(Feb 14 2020 at 20:24)</a>:</h4>
<p>Unfortunatelly we don't have infra for automatic minimization of such problems yet :(</p>



<a name="188242950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242950">(Feb 14 2020 at 20:24)</a>:</h4>
<p>aw :(</p>



<a name="188242977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188242977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188242977">(Feb 14 2020 at 20:24)</a>:</h4>
<p>so yeah, at the moment we just manually minize such bugs, which is a huge time sink</p>



<a name="188243029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243029">(Feb 14 2020 at 20:25)</a>:</h4>
<p><a href="http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/" target="_blank" title="http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/">http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/</a></p>



<a name="188243180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243180">(Feb 14 2020 at 20:26)</a>:</h4>
<p>that doesn't seem relevant to logic level errors like this, that seems more targeted at compilation failures</p>



<a name="188243200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243200">(Feb 14 2020 at 20:27)</a>:</h4>
<p>I also remember a program that does the first step of minimizing rust code, but I can't remember it's name.</p>



<a name="188243305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243305">(Feb 14 2020 at 20:28)</a>:</h4>
<p>I have written no rust code to generate this behaviour</p>



<a name="188243578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243578">(Feb 14 2020 at 20:30)</a>:</h4>
<p>Csmith is supposedly also useful, even though it is technically made for C, not Rust.</p>
<p>Edit: wrong name, meant creduce</p>



<a name="188243710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243710">(Feb 14 2020 at 20:32)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-project.2Ejson/near/188243200" title="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-project.2Ejson/near/188243200">said</a>:</p>
<blockquote>
<p>I also remember a program that does the first step of minimizing rust code, but I can't remember it's name.</p>
</blockquote>
<p>Found it: <a href="https://github.com/jethrogb/rust-reduce" target="_blank" title="https://github.com/jethrogb/rust-reduce">https://github.com/jethrogb/rust-reduce</a></p>



<a name="188243758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243758">(Feb 14 2020 at 20:33)</a>:</h4>
<p>Another thing that helps here is batch mode for rust-analyzer:  <a href="https://github.com/rust-analyzer/rust-analyzer/blob/6711335173f138d444049357495fb2785c2bdd0b/crates/ra_cli/src/main.rs#L83" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/6711335173f138d444049357495fb2785c2bdd0b/crates/ra_cli/src/main.rs#L83">https://github.com/rust-analyzer/rust-analyzer/blob/6711335173f138d444049357495fb2785c2bdd0b/crates/ra_cli/src/main.rs#L83</a></p>



<a name="188243803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243803">(Feb 14 2020 at 20:33)</a>:</h4>
<p>Basically, it asks ra to fully type-check the crate, so it's easy to check if things are broken without restarting LSP server</p>



<a name="188243871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188243871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188243871">(Feb 14 2020 at 20:34)</a>:</h4>
<p>But it is hard-coded for cargo atm: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/6fb36dfdcb91f67c28f51e51514ebe420ec3aa22/crates/ra_cli/src/analysis_stats.rs#L24" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/6fb36dfdcb91f67c28f51e51514ebe420ec3aa22/crates/ra_cli/src/analysis_stats.rs#L24">https://github.com/rust-analyzer/rust-analyzer/blob/6fb36dfdcb91f67c28f51e51514ebe420ec3aa22/crates/ra_cli/src/analysis_stats.rs#L24</a></p>



<a name="188244041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188244041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188244041">(Feb 14 2020 at 20:36)</a>:</h4>
<p>cool. I'll give that a try shortly, want to land a few things first</p>



<a name="188244214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188244214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188244214">(Feb 14 2020 at 20:38)</a>:</h4>
<p>should also be straightforward to break this down to subsections of our build graph programatically</p>



<a name="188244219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188244219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188244219">(Feb 14 2020 at 20:38)</a>:</h4>
<p>that could be helpful</p>



<a name="188245888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188245888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188245888">(Feb 14 2020 at 20:57)</a>:</h4>
<p>Opened <a href="https://github.com/rust-analyzer/rust-analyzer/issues/3149" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/3149">https://github.com/rust-analyzer/rust-analyzer/issues/3149</a></p>



<a name="188246001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188246001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188246001">(Feb 14 2020 at 20:59)</a>:</h4>
<p><span class="user-mention" data-user-id="217516">@Benjamin Brittain</span> one thing I would try first is probably just bumping that limit to 10k. Like, my understanding of the code is that this loop should be really really shallow, but it <em>might</em> be the case that my understanding is wrong, and you ineed hit the limit due to share size. I think this is unlikely, but it is much cheaper to check than doing actual minimization.</p>



<a name="188246037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188246037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188246037">(Feb 14 2020 at 20:59)</a>:</h4>
<p>very true <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span></p>



<a name="188247340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188247340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188247340">(Feb 14 2020 at 21:11)</a>:</h4>
<p>I bumped it up to 10k and the error hasn't show up yet</p>



<a name="188247434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188247434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188247434">(Feb 14 2020 at 21:12)</a>:</h4>
<p>Wow, that means that my understanding is waaaay offf. We need to completely rewrite that bit of code anyway....</p>



<a name="188247768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188247768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188247768">(Feb 14 2020 at 21:17)</a>:</h4>
<p>as a temporary workaround: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/3150" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/pull/3150">https://github.com/rust-analyzer/rust-analyzer/pull/3150</a></p>



<a name="188248247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188248247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188248247">(Feb 14 2020 at 21:22)</a>:</h4>
<p>I look forward to submitting repros in the future though :)</p>



<a name="188268053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/188268053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#188268053">(Feb 15 2020 at 04:06)</a>:</h4>
<p>IIRC，that loop also handle recursive macro expansion in item scopes</p>



<a name="191029361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191029361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191029361">(Mar 18 2020 at 19:20)</a>:</h4>
<p>Ok! So people are actually using it now</p>



<a name="191029368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191029368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191029368">(Mar 18 2020 at 19:20)</a>:</h4>
<p>and are pretty happy</p>



<a name="191029391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191029391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191029391">(Mar 18 2020 at 19:20)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span></p>



<a name="191029502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191029502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191029502">(Mar 18 2020 at 19:21)</a>:</h4>
<p>Only the early adopters though, so let's see what people say when I force their workflows to change <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="191030259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030259">(Mar 18 2020 at 19:27)</a>:</h4>
<p>actually, I'm personally attempting to use LSP for the first time.</p>
<p>Is there a way to make <code>rust-analyzer</code> hang around? I use vim and I open and close all the time</p>



<a name="191030327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030327">(Mar 18 2020 at 19:28)</a>:</h4>
<p>I'd rather not have it reindex every single time, it takes a while</p>



<a name="191030478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030478">(Mar 18 2020 at 19:29)</a>:</h4>
<p><span class="user-mention" data-user-id="217516">@Benjamin Brittain</span> I think this needs to be fixed on the editor side: rust-analyzer is indeed designed to stick around, vim should somehow persist it.</p>



<a name="191030622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030622">(Mar 18 2020 at 19:30)</a>:</h4>
<p>makes perfect sense! I'll write some horrible vimscript then</p>



<a name="191030670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030670">(Mar 18 2020 at 19:30)</a>:</h4>
<p>I resent having any knowledge of vimscript</p>



<a name="191030896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030896">(Mar 18 2020 at 19:32)</a>:</h4>
<p>I <em>think</em> ideally it should be handled by the LSP plugin on the vim's side... Don't know whom to cc for vim+rust-analyzer expertise though, I can only give advice about VS Code and Emacs :Ь</p>



<a name="191030953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030953">(Mar 18 2020 at 19:33)</a>:</h4>
<p>honestly, all the vim lsp options are pretty horrible looking</p>



<a name="191030985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030985">(Mar 18 2020 at 19:33)</a>:</h4>
<p>I've heard good things about coc.rust-analyzer</p>



<a name="191030999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191030999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191030999">(Mar 18 2020 at 19:34)</a>:</h4>
<p><a href="https://github.com/fannheyward/coc-rust-analyzer" target="_blank" title="https://github.com/fannheyward/coc-rust-analyzer">https://github.com/fannheyward/coc-rust-analyzer</a></p>



<a name="191031109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191031109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191031109">(Mar 18 2020 at 19:34)</a>:</h4>
<p>I'm not willing to let it shell out to <code>node</code> unfortunately</p>



<a name="191031186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191031186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191031186">(Mar 18 2020 at 19:35)</a>:</h4>
<p>I've tried switching to  the pre-release version of<code>nvim</code> 0.5 since it has built-in lsp. It seems to be working well actually</p>



<a name="191031974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191031974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191031974">(Mar 18 2020 at 19:42)</a>:</h4>
<p>Yeah, totally understandable. This actually is I think a problem with LSP adoption across editors different from VS Code. </p>
<p>Microsoft are doing something very far-sighted here. They provide high-level API to VS Code for plugins for things like completion and goto definition. They maintain <code>lsp-vscode</code> library, which is a, well, <em>library</em> to bind VS Code API to LSP processes.  For each language, community maintains a language-specific plugin which uses the library. So, the maintenance is distributed, for each language you need to install a separate plugin, which can be pretty high-quality and specialized. </p>
<p>Other editors in contrast try to do a single universal things: an LSP plugin which simultaneously supports all languages and maps LSP concepts directly to low-level editor's UI elements.</p>



<a name="191032477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191032477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191032477">(Mar 18 2020 at 19:46)</a>:</h4>
<p>Yeah, I've been using coc.vim but I really resent the node server running in the background</p>



<a name="191032523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191032523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191032523">(Mar 18 2020 at 19:46)</a>:</h4>
<p><span class="user-mention" data-user-id="217516">@Benjamin Brittain</span> how did you get the nvim 0.5 lsp to work? I never figured it out</p>



<a name="191032552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191032552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191032552">(Mar 18 2020 at 19:47)</a>:</h4>
<p>Also, I agree with everything you said</p>



<a name="191032731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191032731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191032731">(Mar 18 2020 at 19:48)</a>:</h4>
<div class="codehilite"><pre><span></span>&quot; lsp support
lua &lt;&lt; EOF

local nvim_lsp = require&#39;nvim_lsp&#39;
local util = require &#39;nvim_lsp/util&#39;

require&#39;nvim_lsp&#39;.rust_analyzer.setup({
  root_dir = util.root_pattern(&quot;rust-project.json&quot;);
  log_level = vim.lsp.protocol.MessageType.Log;
  message_level = vim.lsp.protocol.MessageType.Log;
})
EOF
autocmd Filetype rust setlocal omnifunc=v:lua.vim.lsp.omnifunc

nnoremap &lt;silent&gt; K     &lt;cmd&gt;lua vim.lsp.buf.hover()&lt;CR&gt;
</pre></div>



<a name="191032793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191032793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191032793">(Mar 18 2020 at 19:49)</a>:</h4>
<p><span class="user-mention" data-user-id="198054">@mark-i-m</span> That's what's in my config right now</p>



<a name="191032808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191032808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191032808">(Mar 18 2020 at 19:49)</a>:</h4>
<p>although, you don't want that <code>root_dir</code> line</p>



<a name="191032949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191032949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191032949">(Mar 18 2020 at 19:50)</a>:</h4>
<p>I'm trying to figure out what the other <code>vim.lsp.buf.*</code> commands do. Basically nothing is documented</p>



<a name="191033487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191033487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191033487">(Mar 18 2020 at 19:54)</a>:</h4>
<p>Thanks I will try that out</p>



<a name="191033499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191033499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191033499">(Mar 18 2020 at 19:55)</a>:</h4>
<p>This is what I currently use for coc.vim: <a href="https://github.com/mark-i-m/dotfiles/blob/464b7f46e52a72896dd485ea2bf63d5b94881cc8/vim/.vimrc#L24-L59" target="_blank" title="https://github.com/mark-i-m/dotfiles/blob/464b7f46e52a72896dd485ea2bf63d5b94881cc8/vim/.vimrc#L24-L59">https://github.com/mark-i-m/dotfiles/blob/464b7f46e52a72896dd485ea2bf63d5b94881cc8/vim/.vimrc#L24-L59</a></p>



<a name="191033996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191033996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191033996">(Mar 18 2020 at 19:58)</a>:</h4>
<p>I'm sure you've seen it by now, but <code>:help lsp</code> contains some info</p>



<a name="191034106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191034106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191034106">(Mar 18 2020 at 19:59)</a>:</h4>
<p>yeah, it's helpful</p>



<a name="191034192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191034192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191034192">(Mar 18 2020 at 20:00)</a>:</h4>
<p>what's a good heuristic for shutting down rust-analyzer <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="191034241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191034241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191034241">(Mar 18 2020 at 20:00)</a>:</h4>
<p>running it in the background is great, but I'd like it to turn itself off it's not used for a while</p>



<a name="191034301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191034301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191034301">(Mar 18 2020 at 20:01)</a>:</h4>
<p>especially since it's a bit of a RAM hog</p>



<a name="191034378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191034378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191034378">(Mar 18 2020 at 20:01)</a>:</h4>
<p>Perhaps just do something simple... no commands in N min -&gt; shut down</p>



<a name="191034393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191034393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191034393">(Mar 18 2020 at 20:01)</a>:</h4>
<p>It's a starting point</p>



<a name="191038661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191038661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191038661">(Mar 18 2020 at 20:37)</a>:</h4>
<p><a href="https://github.com/neovim/nvim-lsp/pull/175" target="_blank" title="https://github.com/neovim/nvim-lsp/pull/175">https://github.com/neovim/nvim-lsp/pull/175</a></p>



<a name="191043565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191043565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191043565">(Mar 18 2020 at 21:18)</a>:</h4>
<p><span class="user-mention" data-user-id="217516">@Benjamin Brittain</span>  I just came across this <a href="https://github.com/neovim/neovim/issues/11389" target="_blank" title="https://github.com/neovim/neovim/issues/11389">https://github.com/neovim/neovim/issues/11389</a>... still looking through but perhaps there are some useful examples</p>



<a name="191044023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191044023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191044023">(Mar 18 2020 at 21:23)</a>:</h4>
<p>oh my, I'm excited to figure out rename :D</p>



<a name="191044145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191044145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191044145">(Mar 18 2020 at 21:24)</a>:</h4>
<p>does rust-analyzer have a singleton pattern? If you launch it twice what happens?</p>



<a name="191044200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191044200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191044200">(Mar 18 2020 at 21:24)</a>:</h4>
<div class="codehilite"><pre><span></span>bwb@bwb ~ $ rust-analyzer --help
Error: Invalid flags: --help

   0: core::result::Result&lt;T,E&gt;::or_else
   1: rust_analyzer::args::Args::parse
   2: rust_analyzer::main
   3: std::rt::lang_start::{{closure}}
   4: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
      std::panicking::try::do_call
             at src/libstd/panicking.rs:303
   5: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:86
   6: std::panicking::try
             at src/libstd/panicking.rs:281
      std::panic::catch_unwind
             at src/libstd/panic.rs:394
      std::rt::lang_start_internal
             at src/libstd/rt.rs:51
   7: main
   8: __libc_start_main
   9: _start
</pre></div>



<a name="191044204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191044204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191044204">(Mar 18 2020 at 21:24)</a>:</h4>
<p>:(</p>



<a name="191044708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191044708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191044708">(Mar 18 2020 at 21:30)</a>:</h4>
<p><code>rust-analyzer help</code></p>



<a name="191044811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191044811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191044811">(Mar 18 2020 at 21:31)</a>:</h4>
<div class="codehilite"><pre><span></span>bwb@bwb ~ $ rust-analyzer help
ra-cli

USAGE:
    rust-analyzer &lt;SUBCOMMAND&gt;

FLAGS:
    -h, --help        Prints help information
</pre></div>


<p><span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="191044916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191044916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191044916">(Mar 18 2020 at 21:32)</a>:</h4>
<p>Yeah, small bug. And it says <code>ra-cli</code> instead of <code>rust-analyzer</code></p>



<a name="191045021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045021">(Mar 18 2020 at 21:33)</a>:</h4>
<p>what happens if two rust-analyzers are running at the same time?</p>



<a name="191045172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045172">(Mar 18 2020 at 21:34)</a>:</h4>
<p>They don't interact. With LSP the client talks to the server via the standard input and output, and <code>rust-analyzer</code> doesn't fork to the background or anything like that.</p>



<a name="191045201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045201">(Mar 18 2020 at 21:34)</a>:</h4>
<p>oh, that's somewhat upsetting</p>



<a name="191045215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045215">(Mar 18 2020 at 21:34)</a>:</h4>
<p>good to know though</p>



<a name="191045264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045264">(Mar 18 2020 at 21:35)</a>:</h4>
<p>I didn't realize LSP used stdin/stdout. That makes sense for the behavior I've seen though</p>



<a name="191045506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045506">(Mar 18 2020 at 21:37)</a>:</h4>
<p>You _could_ write a wrapper that keeps one running instance and forwards requests to it, but it would probably be easy to end up with inconsistencies</p>



<a name="191045663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045663">(Mar 18 2020 at 21:38)</a>:</h4>
<p>There isn't really another option right now. Using <code>vim</code> frequently involves opening and closing buffers rapidly. rust-analyzer can take up to 30 seconds to be responsive on our codebase</p>



<a name="191045692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045692">(Mar 18 2020 at 21:39)</a>:</h4>
<p>E.g. the server can send notifications to the editor (there's one for "workspace loaded") and if you start a second client at a later time there will be no workspace loaded notification for it.</p>



<a name="191045748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045748">(Mar 18 2020 at 21:39)</a>:</h4>
<p>Does that still happen in nvim 0.5?</p>



<a name="191045804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045804">(Mar 18 2020 at 21:40)</a>:</h4>
<p>the speed is related to r-a, not nvim</p>



<a name="191045910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191045910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191045910">(Mar 18 2020 at 21:41)</a>:</h4>
<p>I meant restarting the server when you open a file</p>



<a name="191046068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046068">(Mar 18 2020 at 21:42)</a>:</h4>
<p>sorry, using vim, at least how I do, frequently involves closing <em>all of vim</em>, running some commands, then loading it again</p>



<a name="191046081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046081">(Mar 18 2020 at 21:42)</a>:</h4>
<p>not just buffer manipulation</p>



<a name="191046144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046144">(Mar 18 2020 at 21:43)</a>:</h4>
<p>Can you.. suspend it? <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span></p>



<a name="191046174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046174">(Mar 18 2020 at 21:43)</a>:</h4>
<p>haaa</p>



<a name="191046204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046204">(Mar 18 2020 at 21:43)</a>:</h4>
<p>I guess, but what if I'm opening a different file? :)</p>



<a name="191046284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046284">(Mar 18 2020 at 21:44)</a>:</h4>
<p>Or use one of those fancy file pickers?</p>



<a name="191046307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046307">(Mar 18 2020 at 21:44)</a>:</h4>
<p>oh noes. stop trying to turn my vim into an ide <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="191046346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046346">(Mar 18 2020 at 21:44)</a>:</h4>
<p>I recognize lsp was very much designed for an IDE experience though</p>



<a name="191046550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046550">(Mar 18 2020 at 21:46)</a>:</h4>
<p>I hope we'll be able to either dump the database on exit or always keep it on disk, but it hasn't been a priority</p>



<a name="191046712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046712">(Mar 18 2020 at 21:48)</a>:</h4>
<p>It's a bit of a can of worms and other features might be more important in the long run, like making it faster even during the initial analysis</p>



<a name="191046786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046786">(Mar 18 2020 at 21:48)</a>:</h4>
<p>yeah, it seems like a bad idea to commit to right now</p>



<a name="191046812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046812">(Mar 18 2020 at 21:48)</a>:</h4>
<p>eventually, for sure</p>



<a name="191046906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046906">(Mar 18 2020 at 21:49)</a>:</h4>
<p>oh no. I crashed rust-analyzer :(</p>



<a name="191046970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191046970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191046970">(Mar 18 2020 at 21:50)</a>:</h4>
<div class="codehilite"><pre><span></span>[ ERROR ] 2020-03-18T14:47:57Z-0700 ] /usr/local/share/nvim/runtime/lua/vim/lsp/rpc.lua:308 ]   &quot;rpc&quot;   &quot;rust-analyzer&quot;&quot;stderr&quot;        &quot;thread &#39;main&#39; panicked at &#39;Invalid request\nMethod: textDocument/rename\n error: missing field `newName`&#39;, crates/rust-analyzer/src/lib.rs&quot;
</pre></div>



<a name="191047006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047006">(Mar 18 2020 at 21:50)</a>:</h4>
<p>to be fair, I did not give it a "NewName"</p>



<a name="191047064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047064">(Mar 18 2020 at 21:51)</a>:</h4>
<p>yeah, we don't expect people to violate the lsp protocol ;D</p>



<a name="191047097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047097">(Mar 18 2020 at 21:51)</a>:</h4>
<p>Does it really crash, or does it panic and carry on?</p>



<a name="191047168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047168">(Mar 18 2020 at 21:52)</a>:</h4>
<p>nope, really crashes</p>



<a name="191047193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047193">(Mar 18 2020 at 21:52)</a>:</h4>
<p>panic and carry on seems ok to me</p>



<a name="191047607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047607">(Mar 18 2020 at 21:56)</a>:</h4>
<p>Yeah, we deliberately assume trusted client which sends correct requests at<br>
us. This is to create more pressure to actually fix clients/servers.</p>



<a name="191047732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047732">(Mar 18 2020 at 21:57)</a>:</h4>
<p>to be clear, when you say "trusted client" you don't mean a security boundary, you mean a protocol trust boundary?</p>



<a name="191047884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047884">(Mar 18 2020 at 21:58)</a>:</h4>
<p>He means the human trust...</p>



<a name="191047983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047983">(Mar 18 2020 at 21:59)</a>:</h4>
<p>there's more to think about than humans when clients provide arbitrary buffers to the lsp server</p>



<a name="191047991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047991">(Mar 18 2020 at 21:59)</a>:</h4>
<p>But in some clients you can pretty much manually type the LSP requests. Crashing is a bit harsh then :-)</p>



<a name="191047996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191047996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191047996">(Mar 18 2020 at 21:59)</a>:</h4>
<p>E.g. if you mess up the <code>settings.json</code> with inappropriate configuration type value, we are going to crash very loudly and in some weird place</p>



<a name="191048050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191048050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191048050">(Mar 18 2020 at 21:59)</a>:</h4>
<p>Its about vscode*</p>



<a name="191048164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191048164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191048164">(Mar 18 2020 at 22:00)</a>:</h4>
<p>however, to recap, my concern is with the words "trusted client"</p>
<p>Input is still validated, right?</p>



<a name="191048421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191048421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191048421">(Mar 18 2020 at 22:02)</a>:</h4>
<p>I think it means "non-buggy client". I'm not sure if there are any security implications. If you can run <code>vim</code> and run <code>rust-analyzer</code>, even if you trick the latter into doing something bad, it's nothing you couldn't have done in <code>vim</code> already. It's the same argument as <a href="https://devblogs.microsoft.com/oldnewthing/20060508-22/?p=31283" target="_blank" title="https://devblogs.microsoft.com/oldnewthing/20060508-22/?p=31283">https://devblogs.microsoft.com/oldnewthing/20060508-22/?p=31283</a>.</p>



<a name="191048815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191048815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191048815">(Mar 18 2020 at 22:06)</a>:</h4>
<p>I hate that article with a burning passion</p>



<a name="191048902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191048902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191048902">(Mar 18 2020 at 22:06)</a>:</h4>
<p>software is composed with other bits of software in arbitrary and complex ways. Saying that it's not exploitable now is short-sighted</p>



<a name="191048999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191048999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191048999">(Mar 18 2020 at 22:07)</a>:</h4>
<p>I'm not super worried about the security of the LSP engine in my life</p>



<a name="191049077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191049077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191049077">(Mar 18 2020 at 22:08)</a>:</h4>
<p>but "trusted client" means something quite specific to me, which causes concern</p>



<a name="191049840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191049840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191049840">(Mar 18 2020 at 22:16)</a>:</h4>
<p>So, we validate that requests confirm to the protocol and “crash<br>
gracefully” (via assert and stack unwinding) if it is not the case. We can<br>
replace those asserts with error bubbling and reporting, but it doesn’t<br>
really make sense to me. “Typing requests by hand” is a use case where it<br>
actually might make sense to not terminate outright, but this is pretty<br>
niche.</p>
<p>Security-wise, we also assume that everything is trusted. We don’t directly<br>
execute code today, but we, eg, run cargo check, which can run <a href="http://build.rs" target="_blank" title="http://build.rs">build.rs</a>. At<br>
some point we’ll start executing proc macros, which are also arbitrary<br>
code. Memory-safety wise, rust-analyzer has very little unsafe in general,<br>
except for syntax trees. Syntax trees are 100% cursed crazy unsafe code<br>
internally though, and, while safe interface should be fine, we haven’t<br>
done security oriented testing to make sure that everything is <strong>really</strong><br>
as memory safe as we think.</p>
<p>TL;DR it’s probably not a good idea to expose rust-analyzer via an<br>
Internet-visible port.</p>



<a name="191049968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191049968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191049968">(Mar 18 2020 at 22:18)</a>:</h4>
<blockquote>
<p>but this is pretty niche.</p>
</blockquote>
<p>is it? I'm not doing anything atypical right now I think, just setting up vim</p>



<a name="191050061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191050061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191050061">(Mar 18 2020 at 22:19)</a>:</h4>
<p>I disabled <code>cargo check</code> immediately :) but mostly because we don't have cargo</p>



<a name="191050161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191050161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191050161">(Mar 18 2020 at 22:20)</a>:</h4>
<p>my point is that text editors are increasingly becoming "internet-visible" things</p>



<a name="191050792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191050792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191050792">(Mar 18 2020 at 22:28)</a>:</h4>
<p>Yeah, that’s true, but we need to <strong>support</strong> arbitrary code execution for<br>
proc macros, and that restricts the threat model to “everything should be<br>
fine”. <strong>If</strong> proc macros move to some kind of wasm sandbox, rust-analyzer<br>
will be able to provide good security, as it’ll guarantee no I/O except for<br>
stdin/stdout/stderr and memory safety, but for the time being we are not<br>
explicitly testing for that.</p>



<a name="191051093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191051093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191051093">(Mar 18 2020 at 22:31)</a>:</h4>
<p>ugh, <a href="http://build.rs" target="_blank" title="http://build.rs">build.rs</a> and proc-macros. The banes of my existence</p>



<a name="191051114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191051114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191051114">(Mar 18 2020 at 22:31)</a>:</h4>
<p>yup, that makes sense to me</p>



<a name="191051174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191051174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191051174">(Mar 18 2020 at 22:32)</a>:</h4>
<p>I wouldn't say trusted client though, compliant client doesn't set the same alarm bells off</p>



<a name="191051369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191051369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191051369">(Mar 18 2020 at 22:34)</a>:</h4>
<p><span class="user-mention" data-user-id="217516">@Benjamin Brittain</span> I've given up on nvim-lsp again for now... but I would love to hear if you make progress on stuff!</p>



<a name="191051408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191051408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191051408">(Mar 18 2020 at 22:35)</a>:</h4>
<p>It's working fantastic for me! I'm trying to figure out how to send arbitrary stuff right now</p>



<a name="191051439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191051439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191051439">(Mar 18 2020 at 22:35)</a>:</h4>
<p>but I haven't touched lua in years and I don't know the lsp protocol :)</p>



<a name="191051491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191051491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191051491">(Mar 18 2020 at 22:36)</a>:</h4>
<p>I'll post my config here when I'm all done</p>



<a name="191055374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191055374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191055374">(Mar 18 2020 at 23:20)</a>:</h4>
<p>every time I open a file now my fans goes crazy <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="191421612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191421612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matt rice <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191421612">(Mar 22 2020 at 23:16)</a>:</h4>
<p>This seems interesting. I have been wanting to try and automatically toml -&gt; json but add on json-ld schema in the conversion process, I wonder how open you are to having a json-ld schema for rust-project.json?</p>



<a name="191446583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191446583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191446583">(Mar 23 2020 at 09:04)</a>:</h4>
<p>I'd start with just documenting rust-project.json. I don't think its stable or complex enough to really benefit from a formal schema</p>



<a name="191457870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191457870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191457870">(Mar 23 2020 at 11:03)</a>:</h4>
<p>Not heard about json-ld, but making a <a href="https://json-schema.org/" target="_blank" title="https://json-schema.org/"><code>json-schema</code></a> will be beneficial for the user experience. VSCode provides a <a href="https://code.visualstudio.com/api/references/contribution-points#contributes.jsonValidation" target="_blank" title="https://code.visualstudio.com/api/references/contribution-points#contributes.jsonValidation">json schema validation contribution point</a>. By supplying that, the editor will be able to give the users IntelliSense in the <code>rust-project.json</code> file similarly to how it does in <code>settings.json</code></p>



<a name="191480898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-project.json/near/191480898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matt rice <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-project.2Ejson.html#191480898">(Mar 23 2020 at 14:32)</a>:</h4>
<p>Glad I asked first then.  Not really familiar with json-schema, what I like about json-ld, is the ability to avoid fields like cargo's package.metadata, because its validating the contents rather than the file as a whole thing, so you can tell this field belongs to this schema and some other field another.  I don't really see that from the few json-schema examples i've seen.  Anyhow I don't want to press the issue really.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>